const recursionRoutes = (menuList, routes) => {

    let userMenu = []
    menuList.forEach(menu => {
        routes.forEach(route => {
            if(menu.title === route.meta.title){
                if (menu.children && menu.children.length){
                    route.children = recursionRoutes(menu.children, route.children)
                }
                userMenu.push(route)
            }
        })
        
    });
    return userMenu
}

export default recursionRoutes